package cn.senjoeson.timedowner.dao;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

/**
 * @author Android
 * @date 2017/12/25
 */

public class DBHelper extends SQLiteOpenHelper {

    private static final String TAG = "DBHelper";

    private String SQL_CREATE_TABLE;

    public DBHelper(Context context, String SQL_CREATE_TABLE) {

        super(context, DBConfig.DB_NAME, null, 1);
        this.SQL_CREATE_TABLE = SQL_CREATE_TABLE;
    }


    @Override
    public void onCreate(SQLiteDatabase sqLiteDatabase) {
        // sqLiteDatabase.execSQL(TableBlack.SQL_CREATE);// 创建数据库结构
        sqLiteDatabase.execSQL(SQL_CREATE_TABLE);
    }

    @Override
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int oldVersion, int newVersion) {

        Log.d(TAG, "onUpgrade: " + sqLiteDatabase.getVersion());
    }


}
